<template>
  <router-view />
</template>

<script>

export default {
  name: 'App',
  mounted() {
    // 在应用初始化时调用一次字典数据的获取方法
    this.fetchDicts();
  },
  methods: {
    async fetchDicts() {
      try {
        await this.$store.dispatch('dictionary/fetchDicts');
      } catch (error) {
        console.error('字典数据获取失败', error);
      }
    },
  },
};
</script>

<style lang="scss">
html {
  .el-select__placeholder {
    color: #fff;
  }
  .el-select-dropdown {
    background: #555;

    .el-select-dropdown__item {
      color: #fff;

      &.is-hovering {
        background-color: $color;
      }
    }
  }

  .el-textarea {
    .el-textarea__inner {
      box-shadow: 0 0 0 0 transparent inset;
      width: 100%;
      height: 192px;
      background: #000000;
      border-radius: 24px 24px 24px 24px;
      color: #fff;
      font-size: 16px;
      padding: 15px;
    }
  }

  .avatar-uploader .el-upload {
    border-radius: 50%;
    width: 67px;
    height: 67px;
    background: #d9d9d9;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .el-popper.is-light,
  .el-popper.is-light>.el-popper__arrow:before {
    background: #555;
    color: #fff;
    border: none;
  }

  .el-popper.is-light {
    padding: 0;
  }

  .popover-item {
    text-align: center;
    height: 30px;
    line-height: 30px;
    transition: 0.3s ease;
    cursor: pointer;

    &:first-of-type {
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;
    }

    &:last-of-type {
      border-bottom-left-radius: 4px;
      border-bottom-right-radius: 4px;
    }

    &:hover {
      background: #1fd267;
      color: #fff;
    }
  }
}

#app {
  width: 100%;
  min-height: 100vh;
  font-family: PingFang SC;
  .el-loading-mask {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .el-segmented {
    background: #030605;
    border-radius: 8px 8px 8px 8px;
    height: 38px;
    min-height: unset;
    padding: 4px;
    box-sizing: border-box;
    margin-top: 8px;

    .el-segmented__item-selected {
      border-radius: 8px 8px 8px 8px;
      font-weight: 400;
      font-size: 14px;
      color: #ffffff;
      background: #39ea88;
    }

    .el-segmented__item.is-selected {
      color: #333333;
    }

    .el-segmented__item {
      border-radius: 8px 8px 8px 8px;
      font-weight: 400;
      font-size: 14px;
      color: #ffffff;
      padding: 0 16px;

      &:hover {
        background: none;
      }
    }
  }

  .el-table {
    background-color: transparent;

    tr {
      background-color: transparent;
    }

    .cell {
      color: #ffffff;
    }
  }

  .el-table td.el-table__cell {
    border-color: #333;
  }

  .el-table th.el-table__cell.is-leaf {
    border-color: transparent;
  }

  .el-table__inner-wrapper:before {
    background-color: #333;
  }

  .el-table--enable-row-hover .el-table__body tr {
    &:hover>td.el-table__cell {
      background: #193625;
    }
  }

  .el-table__header-wrapper {
    border-radius: 16px;

    .el-table__header {
      height: 90px;
    }
  }

  .el-table .el-table__cell {
    padding: 14px 0;
  }

  .el-table th.el-table__cell {
    background: #000000;
    font-size: 18px;
    color: #d8d8d8;
    font-weight: 400;
  }

  .el-input__wrapper {
    background: #000000;
    box-shadow: none;

    .el-input__inner {
      color: #fff;
    }
  }

  .el-select--large .el-select__wrapper {
    background: #000000;
    border-radius: 8px 8px 8px 8px;
    box-shadow: none;
    min-height: 46px;
    box-shadow: 0 0 0 1px transparent inset;
    transition: 0.3s ease;
  }

  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 60px auto 30px;

    .total {
      font-size: 14px;
      color: #ffffff;
      margin-left: 50px;
    }

    .el-pagination.is-background .btn-next,
    .el-pagination.is-background .btn-prev,
    .el-pagination.is-background .el-pager li {
      background-color: transparent;
      color: #ffffff;
    }

    .el-pagination.is-background .el-pager li.is-active {
      background-color: #1ec862;
      border-radius: 50%;
    }
  }

  .el-dialog {
    background: #3a3a3a;
    border-radius: 24px;

    &::after {
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 61px;
      display: block;
      content: '';
      background-color: #555;
      border-bottom-left-radius: 24px;
      border-bottom-right-radius: 24px;
    }

    .el-dialog__title {
      color: #fff;
      font-size: 16px;
    }

    .el-dialog__close {
      font-size: 18px;
      color: #fff;
    }

    .el-dialog__headerbtn {
      height: 60px;
    }

    .el-dialog__header {
      border-bottom: 1px solid #666666;
    }

    .el-dialog__footer {
      position: relative;
      z-index: 2;

      .el-button {
        width: 70px;
        background: #000;
        border-radius: 6px;
        border-color: #000;
        color: #fff;
        font-size: 12px;
      }

      .confirm {
        background-color: $color;
        border-color: $color;;
      }
    }

    .el-form {
      width: 90%;
      margin: 16px auto 48px;
      .el-select__wrapper{
        background-color: #555;
        box-shadow: none;
      }
      .el-form-item__label {
        color: #fff;
      }

      .el-input__wrapper {
        background: #555555;
      }
    }
  }
}

.el-message-box {
  background-color: #3a3a3a !important;
  border-radius: 24px !important;
  width: 462px;
  height: 244px;

  .el-message-box__title {
    color: #fff;
    font-size: 16px;
  }

  .el-message-box__header {
    border-bottom: 1px solid #666666;
  }

  .el-message-box__headerbtn {
    top: 5px;
  }

  .el-message-box__close {
    color: #fff !important;
    font-size: 18px !important;
  }

  .el-message-box__container {
    height: 135px;
    justify-content: center;
  }

  .el-message-box__message p {
    color: #fff;
  }

  .el-message-box__btns {
    z-index: 2;
    position: relative;
    padding-top: 18px;

    .el-button {
      width: 70px;
      height: 26px;
      background: #000;
      border-radius: 6px;
      border: none;
      color: #fff;
      font-size: 12px;
    }

    .el-button--primary {
      background-color: #1ec862;
    }
  }

  &::after {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 61px;
    display: block;
    content: '';
    background-color: #555;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }
}
</style>

<style lang="scss">
  .fade_y-enter {
    transform: translateY(5px);
    opacity: 0;
  }
  .fade_y-enter-active {
    transition: 0.3s ease;
  }
  .fade_y-leave {
    transform: translateY(0);
    opacity: 1;
  }
  .fade_y-leave-active {
    transition: 0.3s ease;
  }
  .fade_y-leave-to {
    transform: translateY(5px);
    opacity: 0;
  }

  .fade_in-enter {
    opacity: 0;
  }
  .fade_in-enter-active {
    transition: 0.5s ease;
  }
  .fade_in-leave-active {
    transition: 0.5s ease;
  }
  .fade_in-leave-to {
    opacity: 0;
  }

  .fade_x-enter {
    transform: translateX(50px);
    opacity: 0;
  }
  .fade_x-enter-active {
    transition: 0.4s ease;
  }
  .fade_x-leave-active {
    transition: 0.4s ease;
  }
  .fade_x-leave-to {
    transform: translateX(50px);
    opacity: 0;
  }
</style>

<style lang="scss">
  #app{
    @media screen and (max-width: 1650px) {
      .layout{
        .header{
          height: 80px;
        }
        .main-container {
          height: calc(100vh - 80px);
        }
      }
      .header{
        .container .logo-wrapper .logo{
          width: 40px;
          height: 40px;
        }
        .container .logo-wrapper .logo-name{
          font-size: 24px;
          margin-left: 20px;
        }
        .container .user .name{
          font-size: 16px;
        }
        .container .user .avatar{
          width: 38px;
          height: 38px;
        }
      }


    }
    .layout .main-container .menu{
      width: 260px;
      .title{
        width: 100%;
        font-size: 26px;
      }
      .list{
        width: 100%;
        .item{
          font-size: 18px;
        }
      }
    }
    .layout .main-container .main{
      width: calc(100% - 260px);
    }
    .container .page-tab{
      padding: 10px 25px;
    }
    .page-tab{
      .list .item{
        font-size: 20px;
      }
    }
    .container .right .user .user-info .avatar{
      width: 80px;
      height: 80px;
    }
    .container .right .user .user-info .user-content{
      height: 80px;
      .name{
        font-size: 24px;
      }
    }
    .container .left .ai{
      display: flex;
      justify-content: space-between;
    }
    .main{
      .overview-page .right{
        width: 400px;
        .user{
          width: 400px;
          padding: 25px;
        }
      }
      .overview-page .left{
        width: calc(100vw - 80px - 403px);
      }
      .overview-page .left .ai .event .bottom-part .b-l{
        text-align: left;
      }
      .overview-page .left .ai .report{
        width: 500px;
      }
      .overview-page .left .ai .event .title{
        margin-bottom: 30px;
      }
      .overview-page .left .ai .event .bottom-part .b-l .count{
        font-size: 36px;
        margin-bottom: 15px;
      }
      .overview-page .left .ai .event .bottom-part .row{
        margin-bottom: 40px;
      }
    }
    .analysis-home{
      .statistics .left{
        width: 50%;
      }
      .statistics .right{
        width: 50%;
      }
    }
    .knowledge-page{
      .list .content-wrapper .title{
        padding: 0 20px;
        margin-bottom: 10px;
      }
      .list .content-wrapper .title .t1{
        font-size: 16px;

      }
      .list .content-wrapper .content{
        padding: 0 20px;
      }
      .list .content-wrapper .content .text{
        font-size: 14px;
      }
    }
    .container .left .ai .event .bottom-part .b-r{
      width: 100%;
    }
    .chat-container{
      transform: scale(0.75);
      left: 30px;
      height: calc(100%);
      top: unset;
      bottom: 30px;
      transform-origin: left bottom;
    }
    .chat-btn{
      transform: scale(0.75);
      transform-origin: right bottom;
    }
  }
</style>
